package com.crois.barrier.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crois.barrier.admin.entity.ApiResponseInfo;
import com.crois.barrier.admin.mapper.ApiResponseInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * barrier 响应信息
 * @author Hou Ze Yu
 * @date 2021-10-25 11:58:22
 */
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ApiResponseInfoSvc extends ServiceImpl<ApiResponseInfoMapper,ApiResponseInfo> implements IApiResponseInfoSvc {

    @Override
    public ApiResponseInfo findApiResponseInfoByRouteId(Integer apiRouteId) {
        QueryWrapper<ApiResponseInfo> apiResponseInfoQueryWrapper = new QueryWrapper<>();
        apiResponseInfoQueryWrapper.lambda().eq(ApiResponseInfo::getApiRouteId,apiRouteId);
        return baseMapper.selectOne(apiResponseInfoQueryWrapper);
    }
}
